1. Field of the Invention
The present invention relates to a method of searching data sets (data of a collection of members constituted by a kind of sequential data set) stored in an external storage unit of a computer system, and more particularly to a method of searching data recorded in a count-key-data format.
2. Description of the Related Art
FIG. 1 is a block diagram of a conventional computer system. This computer system includes a central processing unit 1 (hereinafter abbreviated as CPU 1), a storage control unit 2 (hereinafter abbreviated as DKC 2), and an external storage unit (hereinafter abbreviated as DKU 3). DKC 2 has a controller 4 for providing a function of issuing a quasi-completion report and a function of automatically and continuously performing a search operation. In some cases, the computer system has a cache memory 6 for temporarily storing data.
A count-key-data format is known as one of the data record formats of an external storage unit of such a computer system. With this format, a certain number of variable length records are stored in one track. One record is constituted by: a count field for storing an address of its record and the lengths of a key field and a data field respectively allocated after the count field; the key field for storing a key representative of an identification of the record; and the data field for storing data.
FIG. 2 shows a count-key-data format for searching data of a collection of members constituted by a kind of sequential data set. In FIG. 2, C represents a count field, K represents a key field, and D represents a data field. If a data format allows to discriminate data in a data field from other data fields by using data in its key field, as in the case of data constituted by members stored in a directory of partitioned organization data sets, a search operation is performed, for example, by reading the data stored in the key fields 23 to 25 without reading all the data stored in the records 20 to 22.
In a computer system having a central processing unit, a storage control unit, and an external storage unit with the count-key-data format, if the external storage unit has no cache memory, the central processing unit issues a search command for the count-key field of each record during the search operation. On the other hand, the storage control unit receives a search command, searches data, and sends a search completion report for each record. Data read from the external storage unit is temporarily stored in a data buffer of the storage control unit, for the search operation.
FIG. 3 is a schematic diagram illustrating conventional data search operation and control signal transfer when DKC 2 has no cache memory or when DKC 2 has a cache memory and there is a cache miss for search data.
At the connection state of DKC 2 and CPU 1, search data instructed by CPU 1 for each key field is compared with data in the key field read from DKU 3. If this comparison indicates that the data in the key field is equal to, or larger than, member data instructed by CPU 1, a search completion report for the data in the key field is supplied to CPU 1. In accordance with data read from the key fields (collection of members) and member data instructed by CPU 1, the record locations of data sets on DKU 3 are identified and these data sets are subjected to a further process.
Even if the comparison indicates that the data in the key field is smaller than the member data instructed by CPU 1, the search completion report for the data in the key field is supplied to CPU 1. In this case, a search operation for the key field of the next record is performed. If the comparison condition between member data and key field data is not satisfied even after the search process of the last record in the track, DKC 2 starts the search process for the next track (key field search, i.e., comparison) upon reception of an instruction from CPU 1. In this manner, DKC 2 supplies CPU 1 with completion reports (channel END, device END) of processes by DKC 2 inclusive of DKU 3, each time one key field is searched, irrespective of whether or not the comparison condition is satisfied.
In FIG. 3, DKC 2 reads records 30 to 32 from DKU 3 and compares the data in the key fields 33 to 35 of these records with member data instructed by CPU 1. The order of processing is the ascending order of record numbers (30.fwdarw.31.fwdarw.32). CPU 1 issues a key search command 36, and in response to this DKC 2 performs the search operation for the record 30 and issues a completion report 37 to CPU 1 irrespective whether or not the comparison condition is satisfied. If the comparison condition is satisfied, DKC 2 starts reading data in the data field D 38. If not satisfied, another key search command 39 is issued for the key field 34 of the next record 31 to repeat a search process for the key field 34 and a completion report 40. In this manner, until the comparison condition is satisfied, search processes for the key fields of succeeding records are sequentially executed, and DKC 2 receives a search command and returns a completion report for each record.
In IBM manual GG24-3886-00, IBM Storage Subsystem Enhancements, a search process is disclosed in which, if data is already stored in a cache memory of a storage control unit (if there is a cache hit), the search operation continues using this data under the operation of the storage control unit, while the central processing unit maintains connection to the storage control unit.
FIG. 4 is a schematic diagram illustrating conventional search operation and signal transfer when DKC 2 has a cache memory and there is a cache hit. Upon reception of a search instruction from CPU 1, DKC 2 returns a cache hit report 45. Thereafter, CPU 1 issues a key search command for the first record. After the search operation for the data in the cache memory is completed by the operation of DKC 2, a completion report 46 is issued to CPU 1. During this search operation 47 by DKC 2, although CPU 1 and DKC 2 maintain connection, there is no signal transfer therebetween for each key field (each record).
Even if the cache memory 6 does not store data (even if there is no cache hit), CPU 1 issues a search command for each record and DKC 2 reads data from DKU 3 and searches while using the cache memory 6, and thereafter issues the search completion report.
Therefore, CPU 1 is occupied by a particular DKC 2 during the data search operation, irrespective of whether DKC 2 uses a cache memory or whether there is a cache hit.
Apart from the above, DKC 2 with a cache memory can load data from DKU 3 into the cache memory by disconnecting DKC 2 from CPU 1 (generally called off-line load).